package org.linlinjava.litemall.db.domain;

import com.baomidou.mybatisplus.annotation.*;
import lombok.Data;
import org.linlinjava.litemall.db.handler.IntegerArrayJsonTypeHandler;

import java.time.LocalDateTime;
import java.util.ArrayList;
import java.util.Arrays;
@Data
@TableName(value = "litemall_gift_card",autoResultMap = true)
public class LitemallGiftCard {
    @TableId(type = IdType.AUTO)
    private Integer id;

    private String name;

    private Byte type;

    @TableField(value = "category_ids",typeHandler = IntegerArrayJsonTypeHandler.class)
    private Integer[] categoryIds;

    @TableField("`desc`")
    private String desc;

    @TableField("pic_url")
    private String picUrl;

    @TableField(fill = FieldFill.INSERT) //插入时自动填充
    private LocalDateTime addTime;

    @TableField(fill = FieldFill.UPDATE) // 插入 和 更新时 自动填充
    private LocalDateTime updateTime;

    @TableLogic
    private Boolean deleted;

    @TableField("numbers")
    private Integer numbers;

    @TableField("card_no")
    private String cardNo;

    @TableField("add_user_id")
    private Integer addUserId;

    @TableField("status")
    private Integer status;

    @TableField("amount")
    private Integer amount;

    @TableField("classification_id")
    private Integer classificationId;
}